package com.xtx.air.dao.flight.impl;

import java.util.List;

import com.xtx.air.dao.flight.IFlightStorageDAO;
import com.xtx.air.dataobject.FlightDO;
import com.xtx.air.dataobject.FlightStorageDO;
import com.xtx.dao.BaseDAOImpl;

public class FlightStorageDAOImpl extends BaseDAOImpl implements IFlightStorageDAO {

	@Override
	public void addStorage(FlightStorageDO flightStorageDO) {
		flightStorageDO.setSid(null);
		executeInsert("INSERT-FLIGHTSTORAGE", flightStorageDO);
	}

	@Override
	public void updateStorage(FlightStorageDO flightStorageDO) {
		executeUpdate("UPDATE-FLIGHTSTORAGE", flightStorageDO);
	}

	@Override
	public List<FlightStorageDO> findStorage(FlightStorageDO flightStorageDO){
		return executeQueryForList("SELECT-FLIGHTSTORAGE", flightStorageDO);
	}

    @Override
    public List<FlightDO> findFlightIdByStorageCreator(FlightStorageDO flightStorageDO) {
        return executeQueryForList("SELECT-FLIGHT-BY-STORAGE-CREATOR","SELECT-FLIGHT-BY-STORAGE-CREATOR-COUNT",flightStorageDO);
    }

    @Override
    public void deleteStorageByFid(Long fid) {
        executeUpdate("DELETE-FLIGHTSTORAGE-BY-FID",fid);
    }
}